Factor out actions into a separate file

This requires making the state management and passing a bit more explicit.
De-Traceurify :(

Since PEGjs is not Traceur-aware, we were only able to use ES6 in the tiniest parts of the code, so it wasn't worth it. This could be reversed in the future with a PEGjs plugin (like pegcoffee), but for now let's go back to ES5.