Added util/functional.h, moved some existing functionality into it.