Most basic classes moved to a library

A unit test project created for it.
Some cleanup.