Document code, add use keyword to files, some minor improvements