Fix tests and travis support

- Add travis support
- Fix tests cannot run on different platform