Bastion: allow directives to work with ui-router, fixes #2638 and #2686.