Code clean-up

Changes:
 - testing;
 - code clean-up.
Problems:
 - tests which are using sqlite
Fixing guest rpc api tests

Changes:
 - KeyMatcher fix