Added ability for data to be a function

This allows us to control the params sent to the server in a more dynamic manner. This could be used, for example, to give the user the ability to change the applied timezone.