db cleanup code
fixed relaseSigMem signature
Implemented db querying: shape matching works!