Full rewrite in CoffeScript. Includes new settings panel module