Changed function names so that it is more obvious what they belong to.
Sorted out Makefile and usage in README.