tidy up compile.js, move helper functions to bottom
Adds for in for arrays, adds a per file state object

The for inArr construct will itterate through an array. To keep
track of the current itterator variable, a state object was created
to avoid potential variable collisions. This uses events to send
messages across modules. The main state is kept in the root bin file.
Merge branch 'state'