Added init and schemamigration methods. Updated tests