Initial check-in of client and compiler refactor (note: this is incomplete)