Port backend.py to use rigor's db layer.  Tested on browse_app but not crowd_app