Updated wrapper, added reading support and cleaned a few things up.