Huge refactor to properly use mongoose

Apparently it manages itself. Pretty nifty.