Do not print useless newlines when dumping
Make dump port configurable
Improve dump