Make the code more portable and reliable

* Use int32_t instead of int
* typedef int32_t
* Require C++11 now
Add demo and Makefile