Bring templates into source file (and correct spaces/indenting)

* having templates on disk would be fine for a package but is not
  great for AnalysisSuite
* should be slightly quicker as well
* also fix indents for segments & segmentGroups
switch to using sprintf for segments (100x speedup)

* brew is nice, but overkill for the segments in particular
* slight change in precision of coords (6sf with %g spec)