added pypy tests in trevis.yml and refactored some tests