Cleaned up code to prepare for updates

Chuck,

I did a lot of code cleanup and in doing so found quite a few things that slipped through the cracks. Woops...

I did some testing and it all checks out for me. I also re-linted and now I only get error associated with old IE syntax.

Please test and merge if you think we're good.

-Lucas