Structure of ionic liquids in bulk and at interfaces