Swift container support for alternative entry points.

Adapted both Swift and Swift 3 runtimes.
diff --git a/core/swiftAction/epilogue.swift b/core/swiftAction/epilogue.swift
index 428aa52..3488a0a 100644
--- a/core/swiftAction/epilogue.swift
+++ b/core/swiftAction/epilogue.swift
@@ -125,12 +125,12 @@
     }
 }
 
-func _run_main() -> Void {
+func _run_main(mainFunction: [String: Any] -> [String: Any]) -> Void {
     let env = NSProcessInfo.processInfo().environment
     let inputStr: String = env["WHISK_INPUT"] ?? "{}"
 
     if let parsed = _whisk_json2dict(inputStr) {
-        let result = main(parsed)
+        let result = mainFunction(parsed)
         do {
             try print(_Whisk_JSONSerialization.serialize(result))
         } catch {
@@ -141,4 +141,3 @@
     }
 }
 
-_run_main()
diff --git a/core/swiftAction/swiftrunner.py b/core/swiftAction/swiftrunner.py
index 9234aef..5bc859d 100644
--- a/core/swiftAction/swiftrunner.py
+++ b/core/swiftAction/swiftrunner.py
@@ -31,10 +31,17 @@
     def __init__(self):
         ActionRunner.__init__(self, DEST_SCRIPT_FILE, DEST_BIN_FILE)
 
-    def epilogue(self, fp):
+    def epilogue(self, fp, init_message):
+        if "main" in init_message:
+            main_function = init_message["main"]
+        else:
+            main_function = "main"
+
         with codecs.open(SRC_EPILOGUE_FILE, "r", "utf-8") as ep:
             fp.write(ep.read())
 
+        fp.write("_run_main(%s)\n" % main_function)
+
     def build(self):
         p = subprocess.Popen(BUILD_PROCESS)
         (o, e) = p.communicate()
diff --git a/tests/src/actionContainers/SwiftActionContainerTests.scala b/tests/src/actionContainers/SwiftActionContainerTests.scala
index cfe3ce2..1c34e55 100644
--- a/tests/src/actionContainers/SwiftActionContainerTests.scala
+++ b/tests/src/actionContainers/SwiftActionContainerTests.scala
@@ -108,6 +108,22 @@
         ("swift", envCode)
     }, enforceEmptyOutputStream)
 
+    it should "support actions using non-default entry points" in {
+        withActionContainer() { c =>
+            val code = """
+                | func niam(args: [String: Any]) -> [String: Any] {
+                |   return [ "result": "it works" ]
+                | }
+                |""".stripMargin
+
+            val (initCode, initRes) = c.init(initPayload(code, main = "niam"))
+            initCode should be(200)
+
+            val (_, runRes) = c.run(runPayload(JsObject()))
+            runRes.get.fields.get("result") shouldBe Some(JsString("it works"))
+        }
+    }
+
     it should "return some error on action error" in {
         val (out, err) = withActionContainer() { c =>
             val code = errorCode