Documentation

Document most of the parts of the code and added code formating with
some string externalization.