global code, comments and API cleanup

Removing useless const, replacing & with * or implicit-sharing
copies, etc.
Removing 2 useless classes.