Fix for strange scrolling behavior in modal

Placing a datepicker as a component in a bootstrap modal would bind to
the body rather than the element of the modal. This would cause the
datepicker to scroll with the body while the modal remained in place.
This patch binds the datepicker dropdown to the element where it was
invoked and changes the computation of the offset to use position(),
since offset() was relative to the window. Fixes #325.