     /**
         Initialize the Application.
     */
-    public init(sessionDriver: SessionDriver? = nil, config overrideConfig: Config? = nil) {
-
-        let hash = Hash()
+    public init(workDir overrideWorkDir: String? = nil,
+                sessionDriver: SessionDriver? = nil,
+                config overrideConfig: Config? = nil,
+                hash: Hash = Hash(),
+                server: Server.Type = HTTPStreamServer<ServerSocket>.self,
+                router: RouterDriver = BranchRouter()) {
         self.hash = hash
         self.session = sessionDriver ?? MemorySessionDriver(hash: hash)
 
-        let workDir = Process.valueFor(argument: "workDir") ?? "./"
-        self.workDir = workDir
+        let workDir = overrideWorkDir
+            ?? Process.valueFor(argument: "workDir")
+            ?? "./"
+        self.workDir = workDir.finish("/")
 
         let config = overrideConfig ?? Config(workingDirectory: workDir)
         self.config = config

import libc
import MediaType

public class Application {
    public static let VERSION = "0.8.0"

    /**
        The router driver is responsible
        for returning registered `Route` handlers
        for a given request.
    */
    public var router: RouterDriver = BranchRouter()

    /**
        The server driver is responsible
        for handling connections on the desired port.
        This property is constant since it cannot
        be changed after the server has been booted.
    */
    public var server: Server?

    /**
        The session driver is responsible for


        bootRoutes()

        // TODO: Should this be here?
        if config.environment == .production {
            Log.info("Production environment detected, disabling information logs.")
            Log.enabledLevels = [.error, .fatal]
        }

        // no return - code beyond this call will only execute in event of failure
        startServer()
    }

    private func startServer() {
        do {
            Log.info("Server starting ...")
            let server = try serverType.init(
                host: host,
                port: port,
                responder: self
            )
            try server.start()
            Log.info("Server started on \(host):\(port)")
        } catch {
            Log.error("Server start error: \(error)")
        }
