Fix filter functionality

This begins to annoy, why does filter has to be
so hard ?

Better SQL query maybe?
Fix wrong import
Remove all unused imports
Better logic in crypto.py

This makes the module more testable
Add tests for changing the database password
Comment unused method in crypto.py
Add testing for filter and changing database key