Make compatible with 3.2.x and 4.x and add travis CI tests for both