Improvements to the generation of NuGet packages

Resolves #142.
Resolves #144