Moved cleanup code from -dealloc to dedicated method invoked by NSApplicationWillTerminate notification.
Force cleanup to happen on main thread in case we're ever on another thread for some reason?
Added methods to manually open and close device. Devices are now closed by default after init.