Overhauled the utils

Got rid of most of the assembly-based utils and rewrote them in C. The
world is a better place now.

Still need to a do a lot of comments and headers.