This is a helper class for creating custom post types.. I'm sure it doesn't cover everything. PR's welcome.