Improve testing by moving code to sub pkgs and adding travis