CORE-1692 Refactor Fconnection wizard javascript (currently lots of global functions)