Get rid of copy and paste code in installer/ and unify them.

The powershell scripts had lots of duplication. Make the unified
code instead.
Original patch was provided by Craig Ringer.
Cleanup the code for *test* button and add the functionality to test
MSDTC support.