add packager plugin; refactor common code to core project