Cleaned up and refactored the API. Now we have different functions for
adding source datasets for 1D data and 2D data. Function signatures changed.