Better workaround for trailing newline issue @ chrome

instead of a unreacheable last-line; this fix always adds a new line at
the end which is always usable
Also added declaration + title tag to demo-page

refs #5
me and git have some serious talking to do...

recommitting #3
don't use a public memoization of the selection in the editor
move highlighting into a plugin
swap the functions around in the highlight plugin for consistency