browserify the client code

large change to the code structure.  It now is browserified,
which allows to share code easily between client and server.
Also, it finally uses a decent module system to handle
dependencies.