Move JSONEncoder/Decoder from sqlite.py to helper.py since its being reused in two places