Added support for categories

It’s still a bit weird and nothing works right, but it’s good enough
for now.