Made the whole thing into a static library

Also fixed several compiler warnings and added documentation
to a couple files.