Write a function that takes a string as an argument. The function should return an array of the top 3 occurring words in the string in descending order.
If the string contains fewer than 3 unique words then just return the unique words that you have in descending order of appearance.
Matches should be case-insensitive and an empty array should be returned if the string is empty.
'a a a a b b b c c d'
['a', 'b', 'c']
'hey friend, it's great to see a friend. I wish I had another friend like you. What a friend'
['friend', 'a', 'I']
Tests are encouraged. The function can be written in any language you are comfortable with.