WIP: Schema

The idea here is to go through all the user-facing functions and organize them into 3 sections.

 1 - Declare all local variables at the top
 2 - Check the arguments against a static schema
 3 - Perform the action being aware of early exits and cleanup of resources.

There are quite a few memory leaks that are only triggered by various error cases.  This refactor should fix most if not all of them.
Just trying to match what libuv is expected to go through minimal typecasts.
offset declared at https://github.com/joyent/libuv/blob/a4f88760be1838603fe2eae89a651066cc42eedd/include/uv.h#L1072
though I got size wrong, it should be `unsigned int` from https://github.com/joyent/libuv/blob/a4f88760be1838603fe2eae89a651066cc42eedd/include/uv.h#L416