Rewrote indentation logic so that it preserves cursor position

This is taken from https://gist.github.com/tpope/287147 with modifications to
the regular expressions.
Make it possible to turn aligning off