Switch from old ORM to new ORM + some more changes in schema implementation

This can only be tested on android so far.