Travis integration

Enable travis integration, fix infinite loop that can sometimes occur in one unit test