major script rewrite and travis-ci support