unit test improvements; fixes.
docstrings in profile builder.
minor clean up.
added/improved unit tests