Update Chapel codes to ensure correct working with 1.9.0. Tidy up codes a bit, removing redundant type specifications, let the type inference do its work.