Finished adding tests for the _d* functions.

Rewrote the optzero test to be a little more Python (using enumerate instead of looping over an index).