Got algorithms with borders working in the lightspeed compiler.

Summary: Fixes T46.  This diff solves issues with borders not calculating correctly under the lightspeed compiler.  It does this by moving a lot of precalculations into the RuntimeLayer, so that the logic for determining loop start and end positions is confined to a single class, while the lightspeed compiler now just deals with refactoring code.  Currently zooms are still not yet working.

Test Plan: Run `ProceduralGenCompiler` and modify it's `Main.cs` file and play around with executing and compiling various different algorithm structures.  As long as the algorithm structure doesn't contain any zooms, it should work and the result of running `ProceduralGenCompiler` with the structure should be "Compiled layer matches runtime."

Reviewers: Sabre070

Reviewed By: Sabre070

Maniphest Tasks: T46

Differential Revision: http://code.redpointsoftware.com.au/D47