Major refactoring triggerd by data structure change. Buttons sort criteria now set in on place inside HTML data attribute. The end
initializing graph only once user is logged in (ready)
Merged with Colin after refactor