[cleanup] Applied codestyle, fixed compiler warnings, fixed typos, added missing JavaDoc