Clean up duplicated code in include/plugin.php and Zotlabs\Extend\Hook, making the former just wrappers calling the latter. Also removed the unnecessary serialization of arrays in Hook::insert, and cleaned up and expaned the tests a bit.