Fixed #4

Added test and now fallback is more robust and supports legacy requires
as well.