Add function to print number of CPU cores.

I have added a function to print the number of CPU cores using _SC_NPROCESSORS_CONF. And code cleanups.