Rewrote server code for readability and added example directories handling

The server code is now thoroughly commented, and rewritten in a more procedural-like manner but still using Nodes JavaScript asynchronous behaviour. This is done through the tryAsync helper function.

Examples are also read from directories in the /srv/examples directory using config files written in JSON format.