Fix issue where layer doesn't have getBounds as a function property

Looks good so far. I wish I could test it more but our internal feature services are super slow today. I'll definitely revisit this throughout next week.
.
Btw, I was getting an error where layer.getBounds() would return undefined that's why I added additional hadBounds check

And, as you probably already know, some tests are failing. I may look into fixing the tests as well if time permits.