Use sqlite for file logging

Fixes #7