[wip] introduce POJOs API in core and move proto stuff to dedicated module

This compiles but is incomplete and certainly does not pass any test.