Added mongodb server to travis file. Cleaned up some code.