Posts model + separated db

- db.insert now does key generation