Added JavaDocs and fixed some imports.