Fix buffer allocation bug(s).

Apart from writing even more documentation and adding a few more test,
the main bug fixed with this commit concerns array bounds checking and
overflow issues with the wp_suites variable. In particular, the
wp_test_suite_new function has been improved and corrected, as well as
the math around bounds checking in various places throughout the code.