Add :waq for write all an quit, with slight refactoring

Fixes #175