Add happy number algorithm and tests