Cleanup, optimizations and getting closure compiler to work again