Fixing bugs, adding tests, adding travis.