added document persistence

elements created by dynamo will be re-associated when loading the dynamo
file with the same document.
fixed idle thread detection failure due to output nodes
fixed element storage and persistence in custom nodes