Revert "Little progress made. Committing this so my StackOverflow question is up to date."

This reverts commit 49ba6ed8fd0bef9940b38bbc142f7af962d0eb07.
Revert "Committing with serious memory problems. Valgrind is a little bit"

This reverts commit 9f35db964f2ffaa7358af0bdc94e14592df20a84.