Bayesian galaxy shape measurement for weak lensing surveys - I. Methodology and a fast-fitting algorithm | Synapse