Added check for unknown direction and cleanup

In the Applied Energistics interface inventory handler, there was no
check for an unknown direction coming through the constructor. #476
might be caused by an unknown direction.
Also I did some rearrangements, code conventioned attribute names and
general cleanups.