modified lib and tests in pep8 standard, and add tests