Several enhancements

1. Add a container directive, so it can work when the viewport is not window.
2. Observe source change,s so the image can be modifed in runtime.
3. Use methods provided by jquery whenever possible to improve compatibility and accuracy.