Code Optimisations

Improved code efficiency.

Please could you test before reviewing the changes? I do not have Tweetbot installed on my Mac so haven't been able to test, but I don't think that anything should have stopped working.

Used [JSLint guide](http://www.jslint.com/lint.html).