Refactor namespace/shortname parsing into own method

Allows you to more easily create a custom file loader with a custom
namespace syntax.