Update for new till database structure

Use the sqlalchemy models from the till package rather than raw SQL.

Also switch to argparse instead of optparse