Changed to module file structure

Fixed bug with directives