[models] Try to unify multiple ways to compute state_string
There were two ways of computing package state_string:
- state_string instance method doing in python evaluation
- state_string_expression attribute doing the evaluation in the database
This attempts to unify them by keeping the SQL one and providing a basic
facility for in-python evaluation of such simple queries, based on
sqlachemy.evaluator