Moved cookie actions to controller,
Reduced cookies needed for saving collapsed graphs,
Made code more flexible so new metrics can be added easier in the future
Added functions for multiple graphs collapse/expand