Make code SS3.1 compatible

Updated code to work with SS3.1 and Composer

I guess the best approach would be to create a composer.json for the current state (so it can be used via composer with SS <= 3.0) and tag it for SS3.0 compatibility, and then merge in this code as it makes the module compatible with the latest stable version of silverstripe