Rebuild functionality implemented

ADDED: Rebuild function
ADDED: Test for changing data set and rebuild
REMOVED: Commented out code, as part of tidying