Added support for externs, resolves #6