Fix double render when a new template is rendered

This fixes the double render issue we are getting. This is very
noticeable on a first render. The fix is to wait for the layout to
rendered and then only render the views.
Fix failing tests
Api bar improvements

If the api bar is visible and a user clicks elsewhere it closes.
Also use correct icons
API URL style updates, added Velocity.js (http://julian.com/research/velocity/) for use on animated transitions
Code improvements from PR