Merge emitPhoton and emitNewPhoton functions into a single method, see issue #67