Flow query refactor

Better flow query refactor without HSTORE

replaces https://github.com/Tahi-project/tahi/pull/717
I find it harder to read this, when it can be rewritten in plain Ruby:

``` ruby
def self.assigned_to(*users)
  if users.empty?
    Task.none
  else
    joins(participations: :user).where("participations.user_id" => users)
  end
end
```

I usually do this for all scopes that require lambdas.