Move getURL into the common.js file

This also checks the target type. If it is a function, it is invoked when the URL has been loaded. Otherwise, it is expected to be a type with a operationComplete method
Clean up and fix attributes using the xml namespace
We have to add labels to the live document to get a valid bbox for them