Tigher integration with Projectile mode using defadvice.

- Make projectile recognize Grails project types using advices.
 - Advice the default compilation command.
 - Advice the default test command.
 - Advice the project type.

- Cleanup
 - Add some functions docs.
 - Extract some methods for reuse.