Documentation and cleanup

Finished the documentation on the node.js server side of the program and
cleaned up the code a bit.