Code

Many changes so it compiles unter Linux, Solaris and Mac OS X