Fix insert_category (it didn't work at all)

insert_category didn't work at all and it seemed to contain code for an
insert_filetype function, so I wrote both properly using DBO.