Support data class methods in JS, prybin task #4

This is likely to adopt all codereview feedback. It stages changes into 4 commits.