multiple windows now work. added "open in new [tab|window]" context menu entries. refactor some things for modularity