Cleaned up code and added command line args

* The command line args are pretty much useless, but I did this on
  the train ride home because I cannot test the webapp
* Added comments and commented out some unused stuff