Refactor to use sql instead of a python dict. Change deck schema a little.