12.6 removed attachment variable locking

A bunch of code cleanup to remove the locking mechanism for the card
attachment dictionary.
There were a few bugs with the order of events relating to the alignment
function, which were also cleaned up.