Wow, what a mess. Why was I making one giant file to contain everything? I'm splitting it out into several files and taking another crack at completing the decoder.