Allow for specifying imports at beginning of templates

This fixes https://github.com/playframework/playframework/issues/1648