Move handle utility functions to public header, remove more public headers.