Implement createStoreAndActions.

Move custom element registration to a module function.