allow accessing consts in templates
don't rely on express' internal 'mounted' event

restores compatibility with express 4.6.x