Reimplemented gq to match vim behaviour.  Fixes #635