Move lots of code around. Starting to get things shipshape.
Started work on a proper decoder.