better error handling; split loader and app build; refs #14, #15, #16