Fix for KT-4612 support KDoc

Fix http://youtrack.jetbrains.com/issue/KT-4612
re-implemented KDoc task for Gradle, aded integration test.