fixed resolving assembly references

Sorry for the convoluted patchset.
I did a few automated refactorings on the files I touched (move usings into namespaces, convert tabs to spaces).