added unit and function tests and integrated travis