Make into a shared library, with a simple interface

I want to use this program as a PHP module, but the design makes it difficult to write modules for it since intimate knowledge of the internals are needed.

So add a simple function that just takes a block of text as input and returns a block of HTML as output.

Change the makefile to also compile it as a library.

Include a simple test program of the library that also acts as a how-to.