pulled extract_index out to a function
added initial .travis.yml