Added tests and PEP8 fixes.