Add a build system target for running the layout tests.
Perform various cleanup on the layout test runner.

- Fixes a crash when no arguments are supplied.
- Prints usage when too few arguments are supplied.
- Proper handling of text I/O (Unicode).
- Use const references for string parameters.
- Other formatting/stylistic fixes.