Automated Bayesian Layer Counting of Ice Cores