Added typedef functions/basic types, as well as separating text and json outputs