Export is cancellable now

This is with reference to issue #329. I have made export cancellable as discussed. Please verify and let me know if any changes are required.