restructure data to include categories (tabs), create variables for tab lists and rewrite output data so it outputs relevant html