Unix lines. Tests for functools.

Changed to unix new lines. Added unit tests for functools wrappers.
General cleanup.