Structure and magnetization in CoPd thin films and nanocontacts