Fix minor documentation issues.
Use foldr for filter and join.
Cleanly define metafunctions with consistency checks.