Cleanup with AStyle

* Reformat sourcecode to style
Added features to sessionid example.

* Use getopts to parse commandline options.
* -a to add -l to list.
* Added functions to check if table exists, count rows in table.
* Added function to create table if it doesn't exist.