[lib] Use hook instead of connect function in MessageHandler
Test Plan: Checked if onMessage still fired and worked correcly on web and native
Reviewers: palys-swm, ashoat, atul
Reviewed By: ashoat
Subscribers: ashoat, KatPo, zrebcu411, Adrian, atul
Differential Revision: https://phabricator.ashoat.com/D828