Adds database logout to cy

Because we moved off of an in-memory session, we need a database logout.

This pull request adds that database logout. It's not pretty, but...it works.