Made sure UNIT assertions follows (expected, actual) order in comparisons.

This was overlooked for the SREADER module when it was done previously.
Grouped similar function definitions together.

This is done in order to improve readability.
Re-factored UNIT testing framework.

Because some difficulties encountered due to the fact that the previous framework was build around complicated macros, the decision was made to re-make the testing framework entirely. The new framework relies only on macros for capturing call contexts (file, line, function). It is a bit more complicated to use, but its inner workings ought to be more apparent.

* All modules were updated to use the new framework.
* Some module bugs discovered while changing the framework were fixed.