This also contains a light refactor of genesis state parsing, so that the tests file didn't duplicate a lot of this code.