Add a way to create previews for DOM element text. Like DIV and A

Work that was done:
1) Formatting: Reindentation, remove bank spaces, remove empty lines.
2) Remove some unused variables
3) Extract class on core object. Basically it was extracted to function so it can be re-used from different places
4) Create a new function so we can create the preview in some random DOM element