JS-API to start a new session manually

We needed the ability to start a new session. Maybe we'll add more functionality later. It is actually intended to be on top of the other Pull Request (2.4 compatibility), bit i didn't want to include both commits in here, so i just cherry-picked that one.