Move try/catch into its own function.
Use more idomatic style.
Add the implementation of <fx-listener>.
Simplify the implementation and remove dynamic features of <fx-listener>.
Make <fx-listener> actually work.