Fixing main() and warnings.

 - fixing main method and build.sh
 - removing extern C code
 - cleaning up includes
 - removing all warnings
 - adding gitignore