Rework models and queues for market data ingestion

* Move analysis code from queues into models themselves

* Got tests working with sqlite databases

* Horrible surgery on migrations, because sqlite won't do ALTER COLUMN
PROGRESS guess margins do not work that way either