Optimized md5 calc, removed some deps and refactored some code