Added documentation to the gateway.

Internalized all classes/interfaces that were not extendible.