a proper UMD prelude chunk + minimal fixes due to JShint and JSCS