wrapping js modules into own scope, bugs