Initial commit of arbitrary struct packing.

Additionally, did a little bit of refactoring.