Turn client-side javascript into AMD modules.

This uses curl.js [1] as a module loader for client-side javascript.
A quick shim is included [2] so client-side javascript can still run
server-side if DOM manipulation isn't needed.

[1] http://know.cujojs.com/downloads
[2] js/define.js
Merge branch 'master' of gitorious.org:wald/waldmeta