Paste + cleanup

Paste implemented.
Clipboard exception handling.
Cleaned up some deserialization code.
Clipboard cleanup

Cleaned up paste to use the common code in entity factory.