Cleaned output table workspace. Refs #8601.

1. Both output table workspaces are sorted;
2. Empty lines in output peak position offset table workspace are
removed before output;
3. Codes are refactoed for convenience of modifying.