Finish rewrite of dependency handling.
Remove ugly MSVC2012 workarounds and namespace #defines. Style fixup.