updated model view to use more sql step towards dynamic pages

yay.
Merge pull request #3 from katerman/dev

updated model view to use more sql step towards dynamic pages