Database

For the love of god pull this and do testing. I did some testing but I'm tired now (been working on this for 4 hours or so).

All test pass, it seems to work. I know that's what I said for the enums :p 

Let me know if shit breaks. I'm gonna comment tomorrow.