Further clean up in message and key class. Make tests run.