Fixed problems for VS 2012, and moved test classes to separate files