Add a margin parameter to scrollIntoView

Closes #1337