Introduce util directory to share utility functions

Some functions such as MALLOC, FREE etc. are used, but
definitions are scattered. We introduce util directory to share
utility functions.
Check GCC version to switch c++0x or c++11

Since -std=c++11 option is supported by gcc 4.7 or later,
we should check it and switch c++0x if gcc version is less than 4.7.
For instance, Ubuntu 12.04 (LTS) gcc version is still 4.6.