Added AMD Wrapper + merged with @eluceo patch that correcta position/width of span if the element is not visible

Added AMD Wrapper so it plays nicely with requierjs.
Merged with @eluceo patch that correcta position/width of span if the element is not visible