Structural and thermodynamic properties of ionic liquids in the bulk and near the wall