Restructure to extract protocol details
Fix code warnings
Update project for cprotocol.h