Rebase pull request #265 from lodejard/dev

Rebased #265 on top of latest aspnet/dev
Nested classes need to be `private` and at the end of the class (after all the methods, etc.). Does this type need to be public?