There are lots of libraries to do this sort of thing, so I can hardly claim innovation here. My real aim was to produce a small open source project to demonstrate some best practices. So what we have here is:
Apart from all that, I like to think this library is a worthy contender in terms of capability, performance, reliability and ease of use. Contributions welcome.