Code duplication removed. Install requirements and travis.yml updated accordingly.