Add basic templating for the core
Start removing reference to global $.md variable