added NO_EXAMPLES option to avoid building examples (-DNO_EXAMPLES=1)
big cleanup