All instances of $db replaced by idiorm (including Session class)
$app no longer has $db