ws: Use global tunables for setting testing/debug/mock options

Instead of cluttering up function signatures, use global tunables
to set tunables used during testing or in debug mode.