On the Computation of Mordell-Weil and 2-Selmer Groups of Elliptic Curves