Fixed several bugs in AgaviView::(append|prepend)Layer() that occured when another layer was given as the reference point of operation. Closes #518