Measurements of Charmonia Production and a Study of the X(3872) at LHCb