Fixed include directories, added detection code

Directories fixed for CMSIS and stdperiph
Also added very basic proof of concept detection code