Comments, tests, bugfixes and a gradle upgrade