Add template variables.

This adds a global settings option "Show template variables", which then
expands a pane allowing the user to define template variables to be
interpolated via the `{{varname}}` notation inside widget titles, graph
expressions, and frame URLs.
Allow encoding dashboard settings in the URL

This allows the URL hash to contain a Base64-encoded JSON object which is
read/written via Angular encoders/decoders. Currently, it is used by the
dashboard controller to read and merge `globalSettings` at page load, and to
store them back in the URL hash whenever `globalSettings` changes.

Additionally, the AngularJS "hashbang" part of the URL (see [1]) may
contain human-readable overrides for any template variables. Paths may
now look like this:

http://promdash-host/demo-dash#!?host=myhost&service=api#<base64-config>

Both hashbang parts of the URL are optional. Settings are overriden in
the following precedence (later ones override earlier settings):

- config retrieved from server, as saved previously
- config retrieved from base64 hash part of the URL
- template vars retrieved from the hashbang part of the URL

[1] http://docs.angularjs.org/img/guide/hashbang_vs_regular_url.jpg
Use $apply() in ngChanged to immediately propagate model changes.

Otherwise, if ngChanged was used to refresh after changes in frame URLs, the
frame was only reloaded after triggering a second AngularJS dirty checking
cycle.
Merge pull request #46 from prometheus/feature/variables

Add template variables and allow config passing via URL hash