{Reviewer: Mike} Fixing index of mod_data and use of intptr_t

Mike, these changes fix up https://github.com/Metaswitch/sprout/issues/82 and https://github.com/Metaswitch/sprout/issues/81 which you mentioned yesterday. OK to merge?