Refactorings and update of README

Refactors out function definitions from header files to c files. Adds
target for dynamic library and static library. Some improvement
of the README file.