Fixed Makefile to build all targets without conflicts.

Fixed tests where they assumed presence of /dev/tty.

Added building shared library.

Added intall targets for all libraries, headers and executables.
Merge pull request #19 from keithj/devel

Various build improvements