moved a bunch of reusable code in here. this later might get split out into SimpleJSF + SimpleEssentials but it will be fine here for now