Core (examples): Revamp example code and add it to build