Thank you both for your answers.
Allready found out about the addonName, ns = ... part (allthough didn't know it meant namespace).
And impleneted it the same way as Ackis Recipe List does, even with the same names.
Error I made was using the variable directly in the UI.lua file, outside a function.
Once I put it inside a function in the UI.lua (and call that function from the Main.lua) it works as intended.
Guess it has to do something with scanning the lua files before they are acutually executed?
Anyway another small step made on the journey that is called lua programming.