Made note placement relative to grid movement.

Also includes various bug fixes.