Replace deprecated target-dir with PSR-4 autoloading

The Composer docs recommend replacing `target-dir`, which is now [deprecated](https://getcomposer.org/doc/04-schema.md#target-dir), with PSR-4 autoloading.