Just discovered register_post_type(). My god. This changes everything.