implement own handling of |gBrowser.replaceTabWithWindow|

* this is ready for moving a suspended tab properly
move suspended tab to other window properly
tidy up some codes
remove unneeded param to open blank tab
minor fix

* remove trailing commas
* update comments
delete unused function