Indroduce torch support

This is the same feature as https://github.com/michaelochs/BCScanner/pull/3 but with a couple of refactorings to adopt the code style of the rest of the library. Also this ensures that the main library still does not require the `AVFoundation` framework.