Move some useful utilities from another repo.