Added some JavaDoc.
Made it runnable using gradle tasks.