add travis.yml for CI
several bugs fix