Added unwrapping of the jquery encapsulated $document variable

See
http://www.bennadel.com/blog/2630-accessing-document-properties-in-angularjs.htm