move shiv to its own module to make sure it only gets added once
properly clean up documents before saving them