Formatted sources, fixed imports and warnings, and updated file headers