Add optional callback to createPackage

This allows us to create packages programatically.