Database improvements & additions

- [x] Fixed gleez/cms#748