added enum support and removed context constructor dependency. needs an empty constructor to be present though.