Refactoring in materias.rb
Refactoring in profesores.rb

+ Added handlers for existing and error cases
+ Coding style review