Added 'aliases'. Other (mostly internal) refactoring.