Many thanks to @rubensayshi for his initial commits on this in #163, but I had to start from scratch for the master branch first.