Add support for extracting package stubs

Closes #5