Cleaned up ModelBase, enable writing to sqlite