Duplication: several identical compare functions now use `\Collections\compare`.

This introduces a function that needs to be loaded and since functions cannot be autoloaded at this time, I have created function.php which holds some functions for the library. This perpetuated a bunch of autoload changes, most of which should be harmless.