Added learn material class, some random fixes + code style improvements