[Fix #515] Fix code-destroying bug in AlignParameters auto-correction.
Refactor AlignParameters.
Fix code-destroying bug in AlignArray auto-correction.
Extract common code from AlignParameters and AlignArray.

Move into the AutocorrectAlignment module.
Refactor AlignParameters spec.

Bring up-to-date and unify style internally in the file.
Merge pull request #517 from jonas054/fix_align_parameters_bug

Fix alignment auto-correction bug