Add support for Ender Chests. Rearrange code a bit so it is not so nested. Closes #1