Cleanup of implementation done in SNI

This commit provides a large cleanup for the job done in SNI,
and includes some documentation about the classes used in
SNI.