Code cleanup, based heavily on a [PR by @mdedetrich](https://github.com/untyped/sbt-plugins/pull/39), but maintaining compatibility with SBT 0.12
Merge branch 'feature/sbt-0.13' of github.com:untyped/sbt-plugins into feature/sbt-0.13