adding travis ci config
adding test to ensure we are only creating new objects when necessary
adding implementation to pass tests for returned type caching