Removed access code length dependancy

Script now expects access codes to be specified in the json
file. Is also a bit refactored.