How to fix an ineffective Extraction Fan setup in bathroom
There should be ducting the entire way. As it is moisture is able to collect on your insulation, lumber, etc. This can result in mold and rot. 

That said, I doubt that your exhaust venting will be improved by installing full ducting. If airflow is poor it's likely due to a crudded up fan or weak fan motor. Check the fan for collected lint. Clean it thoroughly. You can often remove the fan cage and wash it separately with water. 

Yes, the electrical connections must be in an approved, enclosed junction box. Should anything go awry the compartment can help contain sources of fire.