Add support for error handling

When an error occurs, "lastError" will be set to an appropriate
NSError instance. The method "clearLastError" can be called to set this
to nil.
Version bump: 1.1.0