add permalink functionality from USGS project

see: https://github.com/opengeo/usgs/blob/master/editor/app/static/script/app/Editor.js