Refactor ObservableGen, add more tests