Bug 862055 - Write Library so it can be included in multiple forms via node require call, or client side
Minor API tweeks for handling errors