Move example to examples, add compile method to protocol

Signed-off-by: Eli Skeggs <skeggse@gmail.com>