Random changes playing with layout.

Docstrings, scopes, the API isn't as powerful as it could be or as
flexible as it needs to be...
Minor optimization and cleanup.