Added option to pass the animation duration to the present and dismiss methods.