adds window.instance_eval so that alert,confirm,console,jQuery and other methods are available
fixes line endings when nothing printed
adds explicit focus call to ensure editor is not highlighted by default