Refactoring the editor for implementation of credentials. #93

As said in the issue #93 here are the first part containing only the refactoring of the editor.js.

The basic idea is to have both of the dialog use the same function for the retrieving and population of input field. Later on, I plan to check the property of the node to see if the input is a credential or not.