Analytic foundations

These definitely need to be functions. Right now the analysis page has
become more of a scratch pad than anything else.