Merge pull request #9 from jedireza/event-options

Added optional attach/detach event options
better support for using native bindings
fixed potential race condition with tests