Changes required for JPM

This is work in progress! Makes `examples/toolbar-api` compatible with JPM.