[WIP] Refactoring validation of extension composer.json

This was done in a rush and I've not looked over it yet so don't think too badly of me.

@EXreaction

http://tracker.phpbb.com/browse/PHPBB3-11840