Flexural waves in a periodic non-uniform Euler-Bernoulli beam: Analysis for arbitrary contour profiles and applications to wave control