Mask passwords in output and build log

This should close #259.  The implementation is a bit heavy-handed, but the test cases should prove useful even if you decide to use a different implementation.