Allow passing of object into getData method. Re-add beforeInit/afterInit and add deprecation warnings.