Autotype

Hi,

I have closed my previous pull request since it is a bit broken now and I had always intended to split it into separate changesets. This new pull request contains only the changes required for adding autotype support on OS X. I haven't succeeded in getting CMake to find the library on first build. You have to do "cmake; make; cmake; make install". Apart from that, it all seems to work okay.

Keith.
Why are there two get pid methods?