Autarch/make it suck less

This fixes some bugs and generally makes this module less bad. It'd be good to get some review on this, thus the pull request.