Added a little bit of database support (not finished)