Reengineered auth and template system
Merge remote-tracking branch 'origin/master'