refactored to make entire site client-side, and also use javascript rather than python