Engineering thin films and nanostructures with ion beams