Use models instead of $this->db

Takes care of issue #2225
and use models when appropriet
This was inefficient

realized `page_type_m->get` also might try to real files, when they are not needed.
Merge pull request #2226 from ryun/patch-26

Fixes Issue #2225 & Use models instead of $this->db