Adds reference element option, uses requestAnimationFrame for initial measurement, remove test elements after measurement completes. Change default timeout from 10 seconds to 5 seconds