Adding test vectors, code to dump state. More cleanup.