improve cache handling

and improve unit test
add travis file