Making Javascript play nice with Flask. Don't touch it, I'm close!