Simulation engine streamlining

Streamlined the code of the main Simulation Engine file. Broke parts of
the code out into seperate .js files.
pre-loop functions rationalized so that declarations happen by category
instead of haphazardly