MapKnitter refactoring

Upgrades to MapKnitter done as part of Google Summer of Code.