Code improvements

Moved from a mix of explicit and implicit typing to implicit only.
Embedded classes refactored into own classes.
Naming conventions refactored to _private, camelCase and PascalCase where appropriate.
Moved many into using statements.
If operators changed to use ?:
Null and empty strings changed to use string.isnullorempty.

Probably a few other things too.