Initial commit of detector

Stand-alone detector, this commit should include all necessary files,
except for matlab built-ins.
More optional files exist, for shallow cases, but are not included here.