Add support for alignment by patterns

Closes #7