:lipstick: Remove code duplication around emitting events

There was code in a number of places that formatted the event names
differently depending on whether the event was for a theme or a
package. This change creates an `emitPackageEvent` method that
standardizes the logic for determining if the event is for a package
or a theme and emits the properly formatted event.

Caveat: It makes searching for the source of a given event more
difficult.
Fix ternary operator and parameter passing
Compress assignment of theme into one-liner
Merge pull request #140 from lee-dohm/emit-cleanup

:lipstick: Remove code duplication around emitting events