Added logic to delete sub fields

Signed-off-by: Elliot Condon <e@elliotcondon.com>
Fixed JS issue when duplicating fields

Signed-off-by: Elliot Condon <e@elliotcondon.com>