Stop exporting Size and ByArea

Size still exports X and Y, for json marshalling.

Thanks to Nigel Tao for the suggestion.
Use pointer for flag variables

Thanks to Nigel Tao for the suggestion.
Clean up append to data

Thanks to Nigel Tao for the suggestion.
Replace writeData with ioutil.WriteFile

Thanks to Nigel Tao for the suggestion.