I'll take a look at the irc-logger code.
The point was that each package instance would have a different parameter value. I'm not sure if there is a better way to store parameters for a package instance. I only have the requirement for one instance of the package at the moment which is why the apm_package_id_from_key hack works.
The most obvious fix I've come up with to tracking the package_id is to have each instance keep track of its own package id and give it up on request via a proc. I just need a way to get the package id as the instance starts up.