Tim Farron has resigned as leader of the Liberal Democrats, citing conflict with his Christian faith.