Fixed word wrap bug (CoffeeScript's for loops are too magical) and refactored some more
Improved when to fire word wrap and fix remembered keys bug