Fork of https://github.com/devinus/poolboy with some fixes and improvements