Use JSession to get the session ID

This moves the session_id function out to be a part of JSession. This is important for keeping all data in our session class

And is going to be used in https://github.com/joomla/joomla-cms/pull/4453 when we start abstracting out PHP sessions. In itself this change will change nothing in the CMS.

### Test
Check the method addUserToGroup works as expected. Note the unit tests still pass for this method