Improved method code generation

Greatly enhanced readability of code generation in methods
Subclassed out method types to simplify generation
Fixed MediaTypeFormatter bug