Bug 1020667 - Changes required for JPM

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