Updates to reorganize code

- Fixes issues with AMD
- Decreases minified source by almost 100 bytes
- Less global namespace pollution