fixed singlethread reloading, and functional database system (still no ORM usage)