Moved instruction encoding functions into separate file