Automatically detect includes

Automatically detect includes which must be inlined, reference the
remaining
fixes #2