Fix unchecked warnings, add javadoc and remove obsolete format package.