ensure existance of directories

Signed-off-by: Mattias Andrée <maandree@operamail.com>
fix database path so that private databases are inside the user's home directory

Signed-off-by: Mattias Andrée <maandree@operamail.com>