Allow optional custom container while maintaining the previous performance improvements

Tested as working here (latest Chrome): http://jsfiddle.net/rDm2M/39/

Minified version here: http://jsfiddle.net/rDm2M/40/

See output in the browser console.

I tested with/without getBoundingClientRect, with/without container. Tried to be careful about performance, but didn't actually test that.