Add foss testing and refactor tests to work in masterless environment