Add tests, travis builds and constructor