Fixes bug 899174 Update SignatureSummary middleware

* Refine the SQL for SignatureSummary middleware
* Added a connection close() because we aren't using the base class query()
* Adding tests for SignatureSummary* middleware calls