Respect 'key' prop for root component

Fixes #590.