Fixed teamed entities not working. Added preliminary cross-compile support. Cleaned up some code