Optimized JavaScript

Made the js go a bit faster, removed the 'hiccup' after the activation of things on the toolbar.