Move x86 implementation to a new directory and add minor improvements