Fix ReferenceError on label bubble

In the templates, the way knockout works in letting you access variables
without referencing the owner is by using JavaScript's `with` statement,
so something like:

with ($data) { if (gid) { ... } }

But if gid isn't a property of $data, the JS will try to look on the window
object (or the above with statement if nested) and throw a ReferenceError
if it can't find a `gid` variable anyway. So the solution is just to use
`$data.gid` directly which will return `undefined` if it doesn't exist.

And the reason there's no gid is because a label isn't selected.
Make sure series type is defined in autocomplete data
Fix isFreeText to operate on linkAttributes rather than ids
Merge branch 'recent-js-errors' into beta

* recent-js-errors:
  Fix isFreeText to operate on linkAttributes rather than ids
  Make sure series type is defined in autocomplete data
  Fix ReferenceError on label bubble