Refactored some routines
Added edit/copy dataset interface
Some work on storing dataset