Reorder queue

Used ActiveRecord transactions to deal with validation of user input position.