Verifying Custom Encoding and Locale

I added code to verify that custom encoding and locale options for initdb work. Also misc. changes to example code and support for debugging.