Outer scope and alphabetic ordering

Hi,
as stated in the commit message I moved the private inner classes to outer scope and added an alphabetic order option.