Add Timer class.

Also fixed some unittest errors.
Add travis CI config