Move hex() to view file
Performance improvement

Not super fast, but it loads faster than the previous version, Atom stills can't handle > 2MB files and it freezes a little when the image is > 1MB.