Bayesian reconstruction of the cosmological large-scale structure: methodology, inverse algorithms and numerical optimization