Rename internal functions for better consistency. Also split all tests out to separate files.
Update travis file