Fixed the handling of salt when created and when 
validating a hash so it is compatible with other
implementations.
Added equivalent Main method from the java code.