Countable Interface

Implemented the SPL Countable interface which performs a row count on
the current query. Also added type hinting to several functions.
User Session Query fix