Some work on more complete copy/paste support and an auto save html feature 

More details in the commit messages.