refactored friends, sqlite db config, tests