Move in shared implementation between dotty and scalac.

Those methods ended having same implementation in dotty and scalac.
And even more they are implemented in terms of what is already part of exposed abstractions.
Providing default implementations, that can be overridden in backends if ever needed.
Workaround name-based pattern matching creating tuples for ValDefs.

See comment here: https://issues.scala-lang.org/browse/SI-8989?focusedCommentId=71196&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-71196
 for illustration.
Fix error in BCodeBodyBuilder.

Found by just looking at the code. Interestingly enough none of the tests broke.