Return the readable port in $port.
Add a minor test for CLI situation.
Remove nonworking test that called method that does not exist.
closes issue #30
Return NULL for both Port and PortReadable if asked in CLI context.
Fix some coding style.
Revert major style changes in the rest of the file.
error message is not needed here

I don't think the function refreshSession() need to display error message if session has timed out as its task is to refresh session irrespective of session has timed out or not
Displaying an error message here doesn't seems to be a nice option as newSession() is being called in the next step
Have a look
no need to display an error message here

I don't think the function rollSession() need to display error message if session has timed out as its task is to refresh session irrespective of session has timed out or not
Displaying an error message here doesn't seems to be a nice option as newSession() is being called in the next step
Have a look
error message not needed

as session is being refreshed error message is not needed here
Merge pull request #46 from mebjas/master

bug in session library
Merge pull request #36 from SvenRtbg/issue-30

Return the readable port in $port.