Cleaned up the main controller & added the rAF polyfill.