Port to Mavericks

Ported to Mavericks.
To build on Maverics, type as following:

```
CXXFLAGS=-std=c++11 ./waf configure
./waf
```

This line should be <= 80.