pep8 cleanups
fix append not defined bug.
added test for Data.keypairs
Merge pull request #78 from lxyu/data_keypairs_bug_fix

Data keypairs bug fix