Tidy up (added summary comments, removed unused namespaces).