Methods visually reorganized

Methods sorted alphabetically and grouped into categories. Some comments
improved/added.