Add flot settings and improve code structure

Add basic flot settings for various graphs (lines/scatter/histograms)
Add clear headers for each section of functions
Reorder some sections to make the order more logical
Add function to create a plot