Remove swp/pyc files from repo
Fix unit test failure and add logger module, also some code clean