Started Java datamodel and fixed memory leaks