Fixes for profiles breaking templates and installing of non-default deps

Right, to be specific, the handle_deps/N functions end up eventually calling the 'maybe_lock/3' function that locks down a dependency it hasn't seen before. What I'm worrying about here is locking down files specific to a profile, i.e. test deps being locked down.

Is the lockfile supporting profile-specific data in order to avoid, say, a test run from corrupting a prod run?