Fix/osx10.9

Carsten,

Please find included the updated pull request. I have been trying to integrate matplotlib, iPython, etc. for my own use and eventually for others.

In the process of trying to get them to work, I noticed a few more issues. Most of them are minor like a missing include. Some of them are more serious like including the system Python path in the buildem Python path.

Let me know if you have comments, questions, or fixes.

-- John