Localization

@shaun-edwards 
Can you review what I've done so far? (I hope this is what you meant by making another branch and doing a pull request...) Thanks.
This method of filling the command type/command is repeated everywhere (like an STD).  This should have been a function with a bunch of checks for buffer sizes and memcopy call which would have been cleaner.  (not required for this PR, just an FYI).