Added system encoding/decoding (closes #117 and closes #116)