Optimization: Change registerListeners() to take an associative array. Fixes #14