Move require.js main.js to a template

This fixes #89