Avoid calling public constructor.

This is an alternative to #27 as suggested by @stof. It adds a new dependency which I was hoping to avoid but this is probably safer.