Some serious restructuring, rewriting (ReSharper, thx) and bugfixing.