Upgrade to Kotlin M6 and switch to Gradle

Please notice the changes I had to make to some of the unit tests.  I would be happy to make changes where needed but these were the minimum I needed to get the build to pass.