 
     doCompilation = ->
         stamp('Compiling all the things')
+        settings = loadSettings(sources.settings)
         output = compositePage
-            style   : compileStyleFile(sources.style)
-            script  : compileScriptFile(sources.script)
-            markup  : compileMarkupFile(sources.markup)
+            style               : compileStyleFile(sources.style)
+            script              : compileScriptFile(sources.script)
+            markup              : compileMarkupFile(sources.markup)
+            script_libraries    : compileScriptLibraries(settings)
+            style_libraries     : compileStyleLibraries(settings)
         return output
 
     serveContent = ->
         stamp('Creating server')
-        app = express.createServer()
+        app = express()
 
         app.get '/', (req, res) ->
             res.send(doCompilation())

            compiled_style = data
        return compiled_style

    compositePage = (compiled) ->
        page = """
        <!doctype html>
        <html>
        <head>
            <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.4.1/underscore-min.js"></script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.string/2.3.0/underscore.string.min.js"></script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.3.3/coffee-script.min.js"></script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/0.9.2/backbone-min.js"></script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.9.0/jquery-ui.min.js"></script>
            <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.2/jquery.ui.touch-punch.min.js"></script>
            <script src="https://raw.github.com/Marak/Faker.js/master/Faker.js"></script>
            <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9/themes/base/jquery.ui.all.css">
            <style>
                #{ compiled.style }
            </style>


    sys.puts("Working on #{ project_name }\n#{ project_path }")

    loadSettings = (settings_source_file) ->
        settings_raw = fs.readFileSync(settings_source_file)
        settings = JSON.parse(settings_raw)
        # TODO: Validate settings
        if settings.version isnt proto_version
            quitWithMsg("Error: #{ project_name }'s version (#{ settings.version }) does not match proto's (#{ proto_version })")
        return settings

    compileScriptFile = (script_source_file) ->
        stamp('Compiling script')

