I cannot figure out why none of the approaches are succeding for me. I have placed it as a webpart on the site and tested that i was able to modify the tables by just adding a footer text. But it must be something about reading the custom field.

Where are you adding this code? You need to add this in JSLink property of List web part.
– Ganesh SanapJul 12 '19 at 9:40

It is Sharepoint 2013. I am adding it as web part underneath the list in the page layout.
– DanielJul 12 '19 at 11:10

Are you positive that CATEGORY (exactly that, in all caps) is the internal name of the column? Also, what type of column is it? I created a test list, added a choice column with that exact internal name, with those exact choice values, and added your code as-is through a content editor web part below the LVWP (just as you describe), and your code works fine. The only things I can think of are if you don't have the column internal name right, or if it is a lookup or some other type of column and the column values are not the strings you are expecting.
– Dylan CristyJul 12 '19 at 15:41

I am pretty sure it is CATEOGRY - It is as custom column with a type choice.
– DanielJul 15 '19 at 7:11

I was under the impression that both doing it as a web part or as a JSLink. Will try the JSLink and get back.
– DanielJul 12 '19 at 11:11

Added the Code to a ".js" and put it in SiteAssets. Made a link under misc to ~SiteAssets/Filename.js, but still without luck
– DanielJul 12 '19 at 11:21

@Daniel the URL tokens you can use are ~sitecollection or ~site, not ~SiteAssets. The path in your JSLink should be ~site/SiteAssets/Filename.js.
– Dylan CristyJul 12 '19 at 13:58

Updated the link to match. Made no changes to appearance.
– DanielJul 15 '19 at 7:13

Have you added SP.SOD.executeFunc("clienttemplates.js", "SPClientTemplates", function() { block to make sure clienttemplates.js file is loaded? Are you sure field's internal name is CATEGORY?
– Ganesh SanapJul 15 '19 at 7:34