Reorganize utils

Should be fully API compatible with the existing `utils.py`, I just broke it down into separate files.