Add basic testing files and Travis support.
Fix bug.