Read output streams before calling WaitForExit() to avoid a deadlock for packages with many dependencies.

For packages with many dependencies the output stream from calling NuGet.exe in functions/Run-NuGet can be filled and cause a deadlock [as described on MSDN][1].

Moving the call to WaitForExit() to after the output streams have been read solves this problem.

[1]: http://msdn.microsoft.com/en-us/library/system.diagnostics.processstartinfo.redirectstandardoutput.aspx
Based on my reading of [this list of techniques][1], it looks like there's no other way to get standard output and standard error into separate variables.

[1]: http://social.technet.microsoft.com/wiki/contents/articles/7703.powershell-running-executables.aspx