Add test for private key serialization.

Also move private key tests to their own file while here.