Feature/compiler complete refactor

Cleaner code and now parsing the compiler response as XML and extracting the new k attribute.
I didn't write that bit but you're right, it's not ideal.