This did in fact turn out to be an oversight in the error handling. Now, any
error in the initial connection path will always trip pg_up to be 0.
Fixes#160
This commit implements a massive refactor of the repository, and
moves the build system over to use Mage (magefile.org) which should
allow seamless building across multiple platforms.