first db/file writing action

No real synchronization going on yet, but the skeleton
is there.
refaster slice to set
fix filtering and refactor
make it prouce more or less accurate statements

There are a lot of changes, I should have committed
more, but I hate committing things that don't work. And
by the end of it I was just adding little improvements
here and there until it was just a mess.