optimised indent and changes to foreach

indent is now ~ 3x faster when tested on real code.

using foreach is neater/more D-idiomatic.
Merge pull request #1 from John-Colvin/patch-1

optimised indent and changes to foreach