working version with templates.
Updated to work 100% right on master.
Merge branch 'master' of github.com:edge226/ghmd-cms