Fix issue with trailing whitespace causing commands to treat as arg

- trim whitespace, solving issue of whitespace being considered arg
- parse() now duplicaites `line` and therefore does not manipulate
  original
- using defined preprocessor constants for buffer lengths, etc