new implementation of the database-handling. some tests will be faling for the moment, ill update them till sunday