Start reworking database loading to support parade view

Also use more robust query string parsing and remove further dependency
on old DB code.