[Requirement #8151] - Ensure the source code repository is managed correctly

* Fixed issue in the WebPortal which surfaced when Marmot was merged into Yen. In Yen, users could not open a study if it contains a report because an NullReferenceException would be thrown by the PdfHttpHandler.
The issue was caused related to the ImageServerServerDirectory class (which replaced other classes when we moved to .NET 4). This class checks for thread principal to perform fine-grain access.
When report was accessed via PdfHttpHandler, the thread principal was not set up properly which led to the NullReferenceException later in the code on this line:

var uri = new Uri(string.Format("http://{0}:{1}/wado", ae.ScpParameters.HostName, ae.StreamingParameters.WadoServicePort));
[Requirement #10416] - The RIS will be integrated into the Team Edition workstation
 * Added debug logging code to try and figure out the source of strange login behaviours.
[Requirement #10416] - The RIS will be integrated into the Team Edition workstation
 * Added debug logging code to try and figure out the source of strange login behaviours.
[Requirement #8163] - Ensure the build script repository is managed properly
 * Simplified the hardcoded server addresses so that the build process is more reliable.
[Requirement #10439] - The system shall generate audit logs recording all viewing and modification of patient data

Fixed a null ref exception introduced with the client-side auditing code that could cause the workstation to crash when switching folder systems.  The bug was caused by invalid assumptions about the nullability of the IFolder.FolderSystem property.
[Ticket #10550] - Null reference when performing multiple procedures

Decided to fix this at the root cause level rather than just fixing the symptoms described in the ticket.  Modified the implementation of ItemCollection.Replace(...) so that it computes all rows that need updating prior to updating any rows.  This should prevent weird interactions of the kind that caused this defect.
[Requirement #10416] - The RIS will be integrated into the Team Edition workstation
 * Removed debug logging code.
[Ticket #10550] - Null reference when performing multiple procedures

Forgot to annotate the changed part of the code with the ticket number in prev commit.
[Ticket #10527] - MWL should return a study instance UID that is stored in the RIS system

Fixed an issue where adding a new procedure to an existing order would throw an exception because the StudyInstanceUID field wasn't being set.  Refactored code so that the study instance UID must be passed into the Procedure constructor, so this kind of error can't be made in the future.

Also, for the sake of consistency with the way accession numbers and procedure numbers are generated, refactored the UID generation into a broker.  This may seem like an odd choice, since UID generation doesn't come from the RIS database and arguably has nothing to do with brokers, but it does give consistency to the way unique identifiers are generated and assigned to entities in the RIS, and allows for unit testing with a mock UID broker.
[Ticket #10523] - User can cancel an order from the calendar

Modified the QueryCancelOrderWarnings operation so that it can also return errors, such as if the order has already been completed or cancelled, in which case it can't be cancelled.
Merge