commit comprised of three changes.

- Rewrite of main parser function to avoid clunky use of environments.
- Correct transformations on rectangles.
- Add support for patterns and rasters. Patterns are typically (always?)
  a repeated series of rasterised tiles.