Code + doc cleanups
Worked on template processing and compilation