Properly handle resource errors.

App invocation service now handles resource errors differently, allowing
the clients to differentiate between them based on error codes.
Default event names for drivers.

Builtin drivers generate default event names from their own names now,
so that there's no need to repeat youself in app manifests if these
names are equal.
Pass stuff around by reference.

Raw pointers are bad, and useless when initialized in object
constructors, replace with references.
Cleanup.