Theoretical investigations of bulk and surface properties of group II and group XII metal fluorides