Added support for fetching JSON data representing compiled graph

Added an example compiled graph in examples/27012014.json. Also tidied
some code, moving stuff around and putting stuff in functions. Moved
page elements around for layout reasons.