extract common settings into a shared file

Thanks to @janek-warchol for janek-warchol/eja-mater-demonstration, from where
I have learned a few tweaks.