Added a solution to euler 21 and also broke out some common functionality.