Devectorize norm calculation and avoid code dublication.
Merge pull request #5545 from JuliaLang/anj/norm

Norm cleanup.