Remove global variables for tracking handlers

Previously various handlers were stored in maps with IDs, but because there was
no synchronization, it meant that some functions were not safe for concurrent
use.

Rather than add synchronization, I've removed the maps and used pointers
instead of IDs. This is concurrency-safe and cheaper since no
map lookups are required.
save the pointer of the handlers and added refs to the options
Merge pull request #7 from tecbot/remove-package-variables

Remove package variables (based on #5)