Refactors public functions to accept public types, and changed some types to public. Comments and cleanups.