Text this: Bayesian detection of planetary transits - A modified version of the Gregory-Loredo method for Bayesian periodic signal detection