Add missing cJSON.h include.
Factor out "-pipe" from warning switches.
Add missing line for better readability.
Add test to check the number of peer function.