Refactor the optimiser to be easier to use by grunt/automaton tasks.
Add automaton task, closes #39.

Remove grunt task because it no longer worked with the recent grunt changes.
Should wait for 0.4.0 to be released before working on a new one.