This code was written with the understanding that it only needs to work once. It was not created to be readable, maintainable, well-documented, or bug-free. Much of it was written with little forethought and it is due several refactors that it will never receive. Read at your own risk.