Cleaned up indentation, added public/private identifiers to methods, changed constructor names to __construct().  Lots of stuff in the original library doesn't make much sense.  'allowed_fields' should really be implemented as 'required_fields', for instance.  Also, the caching/DNS/IP stuff seems pretty unnecessary...