cleanup cat and cat_t
add tests
update docs