Improved authentication workflow
Use mustache.js for client-side templating