Support emitting struct pkg to pkg_object.
Convert pkg repo from threads to processes.
Create output directory if it doesn't exist.
Fix repo create logic.