Add doc-comments for input parameters and non-private fields
Also a number of refactoring changes, such as breaking long lines, consistent import order, get rid of all compiler warnings, etc.
Also a number of refactoring changes, such as breaking long lines, consistent import order, get rid of all compiler warnings, etc.