redirector: migrate sql interface to sqlalchemy

* Replace run_sql queries with SQLAchemy query.

Signed-off-by: Leonardo Rossi <leonardo.r@cern.ch>
use `print("{0}: {1}".format(k, v))` and `from __future__ import print_function`