Added all the changes after struggling with installations. No testing yet done on user programs. Hopefully Naoki can test it.