Add rest of crazy headless script, hopfully runs on Travis.