Cleanup.
Separated fitting code into a shared library.
Flattened sources.

Updated header references.
Added useful headers to install.