Added optional attach/detach event options

Related to: #8