Make intrinsic security library available to API

The intrinsic security library is compiled in two versions now. One for
Click and one for the API. Ideally we want just one library that links
in both places. For that to happen, the function to calculate the root
directory in Click must move to a Click independent library.