Support "stub" objects in import

This includes the changes from #282, merged into develop.