Added OpbeatHandler, fixes and cleanups.