Convert to .NET 3.5

Converts target framework to .NET 3.5, with minor code changes to
support conversion.
Merge pull request #82 from chrisofspades/master

Convert to .NET 3.5