Adding serialization support.

Initial pass at adding serialization support.
Added ability to reset session.

Fixed issues with NULL active source as well.