Change the build process to make templates optional
Merge with master