Move "using namespace std" after #includes

...so that namespace "std" already exists when we try to use it,
as it will have been declared by the standard headers #included.
Doing otherwise elicits a warning from clang.
Miscellaneous portability / warning fixes

Remove extra parentheses that clang thinks are there to prevent a
different warning for "if (numConsumedByB = 0) /*assignment intended*/".
Use 0 instead of NULL to initialise non-pointers.
Only const *integral or enumeration* static data members can be portably
initialised within the class definition.
Check stderr is empty, not stdout (fixes test for #46)
Merge pull request #95 from jmarshall/warnings2

Various warning fixes redux