JS backend: generate component functions for data classes.

This appears to fix multi-declaration interaction with data classes when JS back-end is used, I’ve added a test as well. It's part of fixing http://youtrack.jetbrains.com/issue/KT-4219.