Link against protobuf lite instead of full library

The recommended approach for protobuf is linking against the lite
library unless features from the full library are actually needed.
Fix some unhandled cases and style problems
Revert to instance_number check
Use reference instead of pointer for instance
Return correct instance number, typedef for return_type
Verify ports for bootstrap and proxy
Merge pull request #3 from sk8ter/master

add group invite callback
Fix java CMakeLists