Quick formatting updates
Add some docblocks
Clean up deprecated functions, non-performant JS, and global variable references
Remove another user global
Output escaping on setting spage
Merge dev