add metafunctions contracts, tweak a few things re library updates