Move inlined logic to a method.
Use bound instead of function callback for pane creation.
Added data parameter to pane create helper method.
Switch to tab if user want to open the same file for active panel.
Remove file instance from openFiles array when tab is closed.