NOBUG: General coding fixes.

This includes:
- whitespace cleanup.
- variable names normalization.
- comments style.
- unused, undefined fixes.
- small API changes and visibility cleanup.
Merge pull request #1 from stronk7/general_fixes

NOBUG: General coding fixes.