Now works in standalone. Next step is to wrap this all up in a pleasent installer...